package com.supreme.studyserver.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BeanService {

    @Resource
    private JSONObject singletonScope;

    @Resource
    private JSONObject prototypeScope;

    @Resource
    private JSONObject requestScope;

    @Resource
    private JSONObject sessionScope;

    @Resource
    private AsyncTaskService asyncTaskService;

    public void singletonScope() {
        System.out.println("BeanService singletonScope = " + singletonScope.toJSONString());
        asyncTaskService.singletonScope();
    }

    public void prototypeScope() {
        System.out.println("BeanService prototypeScope = " + prototypeScope.toJSONString());
        asyncTaskService.prototypeScope();
    }

    public void requestScope() {
        System.out.println("BeanService requestScope = " + requestScope.toJSONString());
        asyncTaskService.requestScope();
    }

    public void sessionScope() {
        System.out.println("BeanService sessionScope = " + sessionScope.toJSONString());
        asyncTaskService.sessionScope();
    }
}
